﻿package mortal.game.view.autoArena.renderer
{
    import Message.Public.*;
    import com.mui.controls.*;
    import mortal.common.global.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class AutoArenaRankListRenderer extends GCellRenderer
    {
        private var _rank:GTextFiled;
        private var _roleName:GTextFiled;
        private var _careerName:GTextFiled;
        private var _combat:GTextFiled;
        private var _rankInfo:Object;

        public function AutoArenaRankListRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._rank = UIFactory.gTextField("", 18, 18 - 8, 38, 20, this);
            this._roleName = UIFactory.gTextField("", 91 - 15 + 2, 18 - 8, 97, 20, this, GlobalStyle.textFormatBai.center());
            this._careerName = UIFactory.gTextField("", 260 - 10, 18 - 8, 48, 20, this, GlobalStyle.textFormatlan.center());
            this._combat = UIFactory.gTextField("", 369, 18 - 8, 80, 20, this, GlobalStyle.textFormatChen);
            this.pushUIToDisposeVec(UIFactory.bg(0, 42, 469, 2, this, ImagesConst.SplitLine));
            return;
        }// end function

        override public function set data(param1:Object) : void
        {
            var _loc_2:SArenaBasePlayer = null;
            super.data = param1;
            this._rankInfo = param1;
            if (this._rankInfo)
            {
                _loc_2 = this._rankInfo.player;
                this._rank.text = this._rankInfo.rank + "";
                this._rank.textColor = GlobalStyle.colorHuangUint;
                if (this._rankInfo.rank == 1)
                {
                    this._rank.textColor = GlobalStyle.colorChenUint;
                }
                if (this._rankInfo.rank == 2)
                {
                    this._rank.textColor = GlobalStyle.colorZiUint;
                }
                if (this._rankInfo.rank == 3)
                {
                    this._rank.textColor = GlobalStyle.colorLanUint;
                }
                this._roleName.text = _loc_2.name;
                this._careerName.htmlText = GameDefConfig.instance.getECareerNameAddColoer(_loc_2.career);
                this._combat.text = _loc_2.combat + "";
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl();
            this._rank.dispose();
            this._rank = null;
            this._roleName.dispose();
            this._roleName = null;
            this._careerName.dispose();
            this._careerName = null;
            this._combat.dispose();
            this._combat = null;
            this._rankInfo = null;
            return;
        }// end function

    }
}
